import { requireNativeModule } from 'expo-modules-core';

import {
  DLNAPlayerInterface,
  DeviceInfo,
  ExpoDlnaPlayerModuleEvents,
  PlaybackStatus
} from './ExpoDlnaPlayer.types';

// 导出常量
export const SCREEN_MIRRORING = 'SCREEN_MIRRORING';
export const VIDEO_ONLY = 'VIDEO_ONLY';

// 导出类型定义
export type {
  DeviceInfo,
  PlaybackStatus,
  ExpoDlnaPlayerModuleEvents,
};

// 模块接口定义
interface ExpoDlnaPlayerModule extends DLNAPlayerInterface {
  // 所有功能已在DLNAPlayerInterface中定义
  getBufferingStatus(): Promise<object>;
}

// 加载原生模块
export default requireNativeModule<ExpoDlnaPlayerModule>('ExpoDlnaPlayer');
